home *** CD-ROM | disk | FTP | other *** search
/ HamCall (April 1991) / HAMCALL CD-ROM (Buckmaster)(April 1991).BIN / prgming / tctut / readtext.c < prev    next >
C/C++ Source or Header  |  1990-10-14  |  427b  |  19 lines

  1.                                          /* Chapter 10 - Program 4 */
  2. #include "stdio.h"
  3.  
  4. main()
  5. {
  6. FILE *fp1;
  7. char oneword[100];
  8. char c;
  9.  
  10.    fp1 = fopen("TENLINES.TXT","r");
  11.  
  12.    do {
  13.       c = fscanf(fp1,"%s",oneword); /* got one word from the file */
  14.       printf("%s\n",oneword);       /* display it on the monitor  */
  15.    } while (c != EOF);              /* repeat until EOF           */
  16.  
  17.    fclose(fp1);
  18. }
  19.